import Vue from 'vue'
// import VueRouter from 'vue-router'
import VueRouter from '../vue-router'

import Home from '../views/home.vue'
import About from '../views/about.vue'


let routes = [
  {
    path: '/',
    component: Home
  },
  {
    path: '/about',
    component: About,
    children: [
      {
        path: 'a',
        component: {
          render: (h) => <div>aaa</div>
        }
      },
      {
        path: 'b',
        component: {
          render: (h) => <div>bbb</div>
        }
      },
    ]
  },
  
]

Vue.use(VueRouter)

let router = new VueRouter({
  mode: 'hash',
  routes
})

router.beforeEach((form, to, next) => {
  console.log(1)
  next()
})
router.beforeEach((form, to, next) => {
  console.log(2)
  next()
})
export default router